package com.haoze.nurseapp.controller;

import com.haoze.common.response.Result;
import com.haoze.nurseapp.service.WardOverviewService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 病区总览设置
 * @author lufq
 * @date 2020/11/21
 */
@RestController
@Api(value = "病区总览设置")
@RequestMapping("/nurseapp/wardset")
public class WardOverviewController {
    @Autowired
    private WardOverviewService wardOverviewService;
    /**
     * 查询
     * @param wardId
     * @return
     */
    @GetMapping("/query")
    @ApiOperation(value = "病区总览设置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "wardId", value = "病区", required = true),
            @ApiImplicitParam(name = "search", value = "查询条件", required = true),
            @ApiImplicitParam(name = "delFlag", value = "0启用1停用", required = true)
    })
    public Result query(@RequestParam String wardId,@RequestParam(required = false) String search,@RequestParam(required = false) String delFlag) {
        return wardOverviewService.query(wardId,search,delFlag);
    }

    /**
     * 设置启用，停用
     * @param delFlag
     * @param ids
     * @return
     */
    @GetMapping("/updateStatus")
    @ApiOperation(value = "病区总览设置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "delFlag", value = "0启用1停用", required = true),
            @ApiImplicitParam(name = "ids", value = "要修改的数据主键", required = true)
    })
    public Result updateStatus(@RequestParam(required = false) String delFlag,
                        @RequestParam(required = false) String ids) {
        return wardOverviewService.updateStatus(delFlag,ids);
    }

}
